﻿/* ***********************************************
 * Author		:  kingthy
 * Email		:  kingthy@gmail.com
 * Description	:  SinaRequest
 *
 * ***********************************************/

using System;
using System.Collections.Generic;
using System.Text;
using OpenTwitter.SDK.Http;

namespace OpenTwitter.SDK.Tencent
{
    /// <summary>
    /// 针对腾讯接口的APIRequest实现
    /// </summary>
    public abstract class APIRequest : APIRequestBase
    {
        /// <summary>
        /// 根据授权对象实例化对象
        /// </summary>
        /// <param name="oauth">OAuth授权对象</param>
        protected APIRequest(OAuthBase oauth) : base(oauth) { }

        /// <summary>
        /// 增加OAuth授权的参数
        /// </summary>
        /// <param name="requestMethod">请求方法.如GET或POST</param>
        /// <param name="requestUrl">API请求地址</param>
        /// <returns></returns>
        protected override void AddOAuthParameter(RequestMethod requestMethod, string requestUrl)
        {
            //加入format参数
            this.Parameters.Add("format", this.ResponseDataFormat.ToString().ToLower());
            base.AddOAuthParameter(requestMethod, requestUrl);
        } 
    }
}
